var gulp = require('gulp');
var sass = require("gulp-ruby-sass")
var browserSync = require('browser-sync');
var reload = browserSync.reload;

gulp.task('sass' , function(){
	return sass('scss/style.scss')
	.pipe(gulp.dest('css'))
	.pipe(reload({stream:true}));
})

// 监视文件改动并重新载入
gulp.task('serve', function() {
  browserSync({
    server: {
      root: './',
      //baseDir: 'bootstrap-3.3.5'
    }
  });

  gulp.watch(['*.html', 'css/*.css', 'js/*.js'], reload);
  gulp.watch('scss/*.scss',['sass']);
});